#include "sRTTI.h"
#include "sRTTIObject.h"
#include "typeinfo.h"

#pragma warning (push)
#pragma warning (disable : 4996)

namespace sgui
{
namespace rtti
{
	
	sParameterInterface* sSelector::getParameter()
	{
		return m_param;
	}

	sSelector::sSelector(sParameterInterface* param) :
		m_param(param)
	{
		//
	}
		
	sInfo::sInfo(const std::wstring& name, sSelector* selector) :
		m_name(name),
		m_selector(selector)
	{
		m_parameter = m_selector->getParameter();
	}

	sInfo::~sInfo()
	{
		delete m_selector;
		delete m_parameter;
	}
		
	sParameterInterface* sInfo::getParameter()
	{
		return m_parameter;
	}

	const std::wstring& sInfo::getName()
	{
		return m_name;
	};


	// ------------------------------- sClassParameter -----------------------
	
	void sClassParameter::set(const std::wstring& data)
	{
		// nothing to do here
	}

	const std::wstring sClassParameter::get()
	{
		wchar_t temp[64];
		mbstowcs(temp, typeid(m_obj).name(), 64); 
		std::wstring v(L"[ ");
		v += temp;
		v += L" ]";
		return std::wstring(v);
	}

	const EPIFlags sClassParameter::getFlags() const
	{
		return PIF_CHILD;
	}

	const sInfoList* sClassParameter::getChild()
	{
		return &m_list;
	}

	sClassParameter::sClassParameter(sObject& obj) :
		m_obj(obj)
	{
		m_obj.exportRTTI(m_list);
	}

	// ------------------------------- s_TEXT_Selector -----------------------
	
	const std::wstring s_TEXT_Selector::getValue()
	{
		return L"";
	}

	void s_TEXT_Selector::setComponent()
	{
		//
	}
		
	s_TEXT_Selector::s_TEXT_Selector(sParameterInterface* param) :
		sSelector(param)
	{
		//
	}

};
};

#pragma warning (pop)